#ifndef FLEETTEXTCOMMANDTRANSFER_H
#define FLEETTEXTCOMMANDTRANSFER_H
#include <QString>
#include "GeneralDefine.h"
#include <QQueue>
#include <queue>
#include <QMutex>

class FleetService;

class FleetTextCommandTransfer
{
public:
    FleetTextCommandTransfer(FleetService *fleetServiceIn, int maxLogLine);
public:
    int setFleetTextCommandMaxLogLine(int maxIn);
    int parserTexCommand(QString txtCommand);
    int getFleetCommandLog(std::queue<std::string> &fleetCommandLogOut);
private:

    int processClearPath();
    int processPause();
    int processStart();
    int processStop();
    int processSetForkHeight(QString commandStr);
    int processAddSimplePath(QString commandStr);
    int processAddWait(QString commandStr);
    int processAddComplexPath(QString commandStr);
    int processMusic(QString commandStr);
    int processRoller(QString commandStr);
    int processLift(QString commandStr);
    int processLoadMap(QString commandStr);
    int processSetGlobalVelocity(QString commandStr);
    int processCharge(QString commandStr);
    int processClearMessage();
    int processMoveRobotArm(QString commandStr);
    int processAutoDrive(QString commandStr);
    int processWaitDi(QString commandStr);
    int processSetDo(QString commandStr);
    int processShutDown(QString commandStr);
    int processSTARTINTERNALPROGRAM(QString commandStr);
    int processCEASEINTERNALPROGRAM(QString commandStr);
    int processSTOPINTERNALPROGRAM(QString commandStr);
    int processLOADINTERNALPROGRAM(QString commandStr);
    int processSETTRIGOBJLENGTH(QString commandStr);
    int processClearErrorRestoreRun(QString commandStr);
    int processSetRegisterValue(QString commandStr);
    int processSetBarrier(QString commandStr);
    int processSetBorderId(QString commandStr);
    int processSetVehicleBorderOffset(QString commandStr);
    int processPathAuthority(QString commandStr);
    int processScanCAMERATRIGSTART(QString commandStr);
    int processScanCAMERATRIGEND(QString commandStr);
    int processMoveMonitorDi(QString commandStr);

    int saveFleetCommand(QString frameIn);


private:
    UserInfo userInfo;
    FleetService *fleetService;

//    QQueue<QString> fleetCommandLog;
    std::queue<std::string> fleetCommandLog;
    QMutex usingMutex;
    int maxFleetCatchLineForDebug;
};

#endif // FLEETTEXTCOMMANDTRANSFER_H
